/* 
* Copyright 2024 - 2024 the original author or authors.
* 
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* 
* https://www.apache.org/licenses/LICENSE-2.0
* 
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.ai.arch.java.ai.agentic.patterns.workflow.parallelizationl;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

import java.util.List;

@Slf4j
//@Component
@RequiredArgsConstructor
public class ParallelizationlWorkflowBean implements ApplicationRunner {

	private final ParallelizationlWorkflow workflow;

	@Override
	public void run(ApplicationArguments args) throws Exception {
		List<String> parallelResponse = workflow.parallel("""
						分析市场变化将如何影响该利益相关者群体。
						提供具体影响和建议的行动。
						格式清晰，包含明确的章节和优先级。
						""",
				List.of(
						"""
								客户：
								- 价格敏感
								- 想要更好的技术
								- 环境问题
								""",

						"""
								员工：
								- 担心工作保障
								- 需要新技能
								- 想要明确的方向
								""",

						"""
								投资者：
								- 期望增长
								- 想要控制成本
								- 风险问题
								""",

						"""
								供应商：
								- 产能限制
								- 价格压力
								- 技术转型
								"""),
				4);
		log.info("Parallelizationl {}", parallelResponse);
	}
}
